#ifndef __DriverEngagementLevelAnalysis_h
#define __DriverEngagementLevelAnalysis_h

#include <stdint.h>
#include <stdbool.h>
#include <time.h>
#define TIME_INTERVAL			10
#define TIME_SIZE  			    100
#define SHORT_DISTRACT_SIZE     (30000/TIME_INTERVAL)
#define LONG_DISTRACT_TIME      (3000/TIME_INTERVAL)
#define UNRESPONSIVE_TIME		(6000/TIME_INTERVAL)
#define ATTENTIVE_TIME          (2000/TIME_INTERVAL)
#define SHORT_DISTRACT_TIME     (SHORT_DISTRACT_SIZE/3)
//#define GET_TIME (time_stamp())
//#define TIME_OUT(prevtime, val) ((GET_TIME) - (prevtime) >= (val))
typedef unsigned int TIME_T;  
typedef enum
{
	/* 驾驶员专注状态提醒（如：专注驾驶，左右顾盼，没法判断等） */
	NotDetermined=0,			
	EyesOnRoad,				
	EyesOffRoad,				
	Faulty,
}DMS_DrvrAlertSt;

typedef struct
{
	DMS_DrvrAlertSt EyesSt;
	int 			time;
}EyesStatus_t;

typedef struct
{
	unsigned int attentive_time;
	unsigned int short_time;
	unsigned int long_time;
	unsigned int NotDetermined_time;
}Dis_Status_t;
typedef struct
{
	/* 在此添加分心算法结果 */
	uint8_t DMS_1_DrvrDistrLvl;			//驾驶员分心等级
	uint8_t DMS_1_DrvrDistrLvlCfdec;	//驾驶 员分心等级置信度
	uint8_t DMS_1_DrvUnrspvSt; 			//驾驶员未响应等级
}DrvrDistr_t;
typedef enum
{
	/*分心等级*/
    E_NOTACTIVE_STATE      = 0,
    E_ATTENTIVE_STATE      = 2,
    E_SHORT_DISTRACT_STATE = 3,
    E_LONG_DISTRACT_STATE  = 4,
    E_NOT_DETERMINED_STATE = 6,
}DISTRACT_STATE;

typedef enum
{
	/*未响应状态*/
    D_NOTACTIVE_STATE      = 0,
    D_UNRESPONSIVE_STATE,
}UNRESPONSIVE_STATE;
#ifdef __cplusplus
extern "C" {
#endif
extern bool DriverEngagementLevelAnalysis(DrvrDistr_t out_DrvrDistr);
void DMS_CacheEyesStatus(DMS_DrvrAlertSt in_AlertSt);
void distract_state(void);
unsigned int time_stamp(void);
#ifdef __cplusplus
}
#endif
#endif